<?php

namespace App\Models;


use App\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ChatRoom extends Model
{

    use HasFactory, HasDateTimeFormatter;

    protected $table = 'chat_room';

    protected $casts = [
        'room_id' => 'integer',
    ];

    protected $fillable = [
        'room_id'
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function owner()
    {
        return $this->belongsTo(User::class, 'room_id');
    }
}
